﻿<phone:PhoneApplicationPage 
    x:Class="Croxweb.Leuphana.Pages.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:login="clr-namespace:Croxweb.Leuphana.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:tilt="clr-namespace:ControlTiltEffect"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800" 
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    shell:SystemTray.IsVisible="False">

    <!--Transitions-->
    <toolkit:TransitionService.NavigationInTransition>
        <toolkit:NavigationInTransition>
            <toolkit:NavigationInTransition.Backward>
                <toolkit:TurnstileTransition Mode="BackwardIn"/>
            </toolkit:NavigationInTransition.Backward>
            <toolkit:NavigationInTransition.Forward>
                <toolkit:TurnstileTransition Mode="ForwardIn"/>
            </toolkit:NavigationInTransition.Forward>
        </toolkit:NavigationInTransition>
    </toolkit:TransitionService.NavigationInTransition>
    <toolkit:TransitionService.NavigationOutTransition>
        <toolkit:NavigationOutTransition>
            <toolkit:NavigationOutTransition.Backward>
                <toolkit:TurnstileTransition Mode="BackwardOut"/>
            </toolkit:NavigationOutTransition.Backward>
            <toolkit:NavigationOutTransition.Forward>
                <toolkit:TurnstileTransition Mode="ForwardOut"/>
            </toolkit:NavigationOutTransition.Forward>
        </toolkit:NavigationOutTransition>
    </toolkit:TransitionService.NavigationOutTransition>
    
    
    <!--LayoutRoot-->
    <Grid x:Name="LayoutRoot">
       
        <!--Panorama-->
        <controls:Panorama Title="Leuphana" SelectionChanged="Panorama_SelectionChanged">
            
            <!--Menu-->
            <controls:PanoramaItem Header=" ">
                <StackPanel Margin="12,0,0,17">
                    <Button Click="Button_Schedule"  Content="Stundenplan" Style="{StaticResource ListButtonStyle}" tilt:TiltEffect.IsTiltEnabled="True" />
                    <Button Click="Button_Messages" Content="Nachrichten" Style="{StaticResource ListButtonStyle}" tilt:TiltEffect.IsTiltEnabled="True" />
                    <Button Click="Button_Persons" Content="Personen" Style="{StaticResource ListButtonStyle}" tilt:TiltEffect.IsTiltEnabled="True" />
                    <Button Click="Button_Settings" Content="Einstellungen" Style="{StaticResource ListButtonStyle}" tilt:TiltEffect.IsTiltEnabled="True" />
                    <Button Click="Button_Logout" Content="Abmelden" Style="{StaticResource ListButtonStyle}" tilt:TiltEffect.IsTiltEnabled="True" />
                </StackPanel>
            </controls:PanoramaItem>
            
            <!--Next events-->
            <controls:PanoramaItem Header="Termine">
                <ScrollViewer>
                    <StackPanel>
                        <TextBlock Text="{Binding NextAppointmentsDay}" TextWrapping="Wrap" Style="{StaticResource PhoneTextLargeStyle}" />
                        <ListBox Margin="0,0,-12,0" ItemsSource="{Binding NextAppointments}" SelectionChanged="Appointments_SelectionChanged"
                                 ItemTemplate="{StaticResource AppointmentListTemplate}" ScrollViewer.VerticalScrollBarVisibility="Disabled">
                        </ListBox>
                    </StackPanel>
                </ScrollViewer>
            </controls:PanoramaItem>
            
            <!--Messages-->
            <controls:PanoramaItem Header="Nachrichten">
                <ListBox Margin="0,0,-12,0" ItemsSource="{Binding NewMessages}" SelectionChanged="Messages_SelectionChanged"
                         ItemTemplate="{StaticResource MessageNewTemplate}" />
            </controls:PanoramaItem>
            
        </controls:Panorama>

        <!--Login Control-->
        <login:MyStudyLogin IsLoggedIn="{Binding IsLoggedIn}" Login="MyStudyLogin_Login"
                            ShowCertClick="MyStudyLogin_ShowCertClick"
                            ShowPortalClick="MyStudyLogin_ShowPortalClick" />

        <!--Progress Bar-->
        <toolkit:PerformanceProgressBar IsIndeterminate="{Binding IsSynchronizing}" Foreground="{StaticResource PhoneAccentBrush}"
                                        Visibility="{Binding IsSynchronizing, Converter={StaticResource BooleanVisibilityConverter}}"
                                        VerticalAlignment="Top" />

    </Grid>


</phone:PhoneApplicationPage>